package com.bestescortbedsystem.service.impl;

import com.bestescortbedsystem.dao.SesHospitalinfoLogDao;
import com.bestescortbedsystem.entity.SesHospitalinfoLog;
import com.bestescortbedsystem.service.LogService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class LogServiceImpl implements LogService {
    @Resource
    private SesHospitalinfoLogDao sesHospitalinfoLogDao;
    @Override
    public Map<String, Object> getAllLog(String pageNumber, Integer pageSize) {
        List<SesHospitalinfoLog> list=new ArrayList<>();
        PageHelper.startPage(Integer.parseInt(pageNumber), pageSize);
        list=sesHospitalinfoLogDao.selectAll();
        PageInfo<SesHospitalinfoLog> sesHospitalinfoLogPageInfo=new PageInfo<>(list);
        List<SesHospitalinfoLog> logList=sesHospitalinfoLogPageInfo.getList();
        Map<String,Object> map=new HashMap<>();
        map.put("rizhi",logList);
        map.put("page",sesHospitalinfoLogPageInfo);
        return map;
    }
}
